package com.nifostasky.db;

import android.content.Context;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public class DataBaseOpenHelper extends SQLiteOpenHelper {
//初始化数据库
    public DataBaseOpenHelper(@Nullable Context context) {
        super(context, "nifostasky", null, 1);
    }

    //数据库被创建的时候调用
    @Override
    public void onCreate(SQLiteDatabase db) {
        System.out.println("创建数据库");
        String sql = "create table setInfo( showKey int ,volumePage int,setId int)";
        db.execSQL(sql);
        System.out.println("创建数据库成功");
    }

    //更新数据库
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
